import type { RouteRecordRaw } from 'vue-router'
// import child from '@/views/shopCart/child'
/**
 * 静态路由（默认路由）
 */
export const Routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'LoginIndex',
    component: () => import('@/views/login/index.vue'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/Register/index.vue'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/adminCenter',
    name: 'AdminCenter',
    component: () => import('@/views/adminCenter/index.vue'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/notFound/index.vue'),
    meta: {
      // 是否显示底部tab
      isShow: false
    }
  },
  {
    path: '/',
    name: 'Home',
    component: () => import('@/views/home/index.vue'),
    meta: {
      // 是否显示底部tab
      isShow: true
    }
  },

  {
    path: '/category',
    name: 'Category',
    component: () => import('@/views/category/index.vue'),
    meta: {
      // 是否显示底部tab
      isShow: true
    }
  },
  {
    path: '/buy',
    name: 'Buy',
    component: () => import('@/views/buy/index.vue'),
    meta: {
      // 是否显示底部tab
      isShow: true
    }
  },
  {
    path: '/shopcart',
    name: 'ShopCart',
    redirect: '/shopcart/cart',
    meta: {
      // 是否显示底部tab
      isShow: true
    },
    children: [
      {
        path: '/shopcart/cart',
        name: 'Cart',
        component: () => import('@/views/shopCart/index.vue')
      },
      {
        path: '/shopcart/child',
        name: 'Child',
        component: () => import(`@/views/shopCart/child/index.vue`)
      },
      {
        path: '/shopcart/order',
        name: 'Order',
        component: () => import(`@/views/shopCart/order/index.vue`)
      }
    ]
  },
  {
    path: '/center',
    name: 'Center',
    component: () => import('@/views/user/index.vue'),
    meta: {
      isShow: false
    }
  },
  {
    path: '/search',
    name: 'Search',
    redirect: '/search/index',
    meta: {
      // 是否显示底部tab
      isShow: false
    },
    children: [
      {
        path: '/search/index',
        name: 'Name',
        component: () => import('@/views/search/index.vue'),
        meta: {
          // 是否显示底部tab
          isShow: false
        }
      },
      {
        path: '/search/goods',
        name: 'Goods',
        component: () => import('@/views/search/goodsList.vue'),
        meta: {
          // 是否显示底部tab
          isShow: false
        }
      }
    ]
  },
  {
    path: '/detail',
    name: 'Detail',
    component: () => import('@/views/Detail/index.vue'),
    meta: {
      // 是否显示底部tab
      isShow: false
    }
  },

  {
    path: '/:pathMatch(.*)',
    name: 'Any',
    redirect: '/404',
    meta: {
      // 是否显示底部tab
      isShow: false
    }
  }
]
